const path = require('path');

module.exports = {
    entry: {
        popup: './src/js/popup.js',
        content: './src/js/content.js',
        background: './src/js/background.js'
    },
    output: {
        filename: '[name].bundle.js',
        path: path.resolve(__dirname, 'dist'),
        clean: true
    },
    module: {
        rules: [
            {
                test: /\.ts$/,
                use: 'ts-loader',
                exclude: /node_modules/
            },
            {
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },
            {
                test: /\.scss$/,
                use: ['style-loader', 'css-loader', 'sass-loader']
            }
        ]
    },
    resolve: {
        extensions: ['.ts', '.js'],
        fallback: {
            "path": false,
            "fs": false
        }
    },
    devtool: 'source-map',
    mode: 'development',
    optimization: {
        splitChunks: {
            chunks: 'all',
            name: 'vendor'
        }
    },
    performance: {
        hints: false
    }
}; 